﻿//===============================ParameterForm.cs==============================\\
//===Bart Steijlen======\\


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Team2_Vision
{
    
    public partial class ParameterForm : Form
    {
        int i = 0;

        public ParameterForm(int form)
        {
            i = form;
            InitializeComponent();
            ParameterTextBox.Text = "3";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int waarde = 0;
            try
            {
                waarde = Convert.ToInt32(ParameterTextBox.Text);
            }
            catch (Exception)
            {
                waarde = Convert.ToInt32(ParameterTextBox.Text.Substring(0, ParameterTextBox.Text.Length - 1));
            }
            if (i == 1)
            {

                MainForm.setParameter(waarde);
            }
            if (i == 2)
            {
                OCRForm.setParameter(waarde);
            }
            this.Close();
        }

        private void ParameterSlider_Scroll(object sender, EventArgs e)
        {
            if (ParameterSliderMatrix.Value % 2 == 0)
            {
                ParameterSliderMatrix.Value++;
            }

            ParameterTextBox.Text = ParameterSliderMatrix.Value + "";
        }

        private void ParameterTextBox_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void ParameterSliderPercentage_Scroll(object sender, EventArgs e)
        {
            ParameterTextBox.Text = ParameterSliderPercentage.Value + "";
        }

    }
}
